package com.fkcai.hansoul.common.exception;

import com.fkcai.hansoul.common.util.ResultCode;

/**
 * 基础业务异常类
 * 所有自定义业务异常都应继承此类
 */
public class BaseBusinessException extends RuntimeException{
	private final ResultCode resultCode;
	private final String message;
	
	public BaseBusinessException(ResultCode resultCode) {
		super(resultCode.getMessage());
		this.resultCode = resultCode;
		this.message = resultCode.getMessage();
	}
	
	public BaseBusinessException(ResultCode resultCode, String message) {
		super(message);
		this.resultCode = resultCode;
		this.message = message;
	}
	
	public BaseBusinessException(ResultCode resultCode, String message, Throwable cause) {
		super(message, cause);
		this.resultCode = resultCode;
		this.message = message;
	}
	
	public ResultCode getResultCode() {
		return resultCode;
	}
	
	public String getMessage () {
		return message;
	}
}
